<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>垂直分步滚动动画</title>
    <style>
      .container {
        width: 500px;
        height: 400px;
        margin: 100px auto;
        overflow: hidden;
        border: 1px solid #ccc;
      }

      .box {
        animation: verticalScroll 6s infinite;
      }

      .box-item {
        display: flex;
        flex-direction: column;
      }

      .item {
        height: 100px;
        background-color: red;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: white;
      }

      .item:nth-child(2) {
        background-color: blue;
      }

      .item:nth-child(3) {
        background-color: green;
      }

      .item:nth-child(4) {
        background-color: orange;
      }

      /* 垂直分步滚动动画 */
      @keyframes verticalScroll {
        0%,
        16.67% {
          transform: translateY(0);
        }
        25%,
        41.67% {
          transform: translateY(-100px);
        }
        50%,
        66.67% {
          transform: translateY(-200px);
        }
        75%,
        91.67% {
          transform: translateY(-300px);
        }
        100% {
          transform: translateY(-400px);
        }
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="box">
        <div class="box-item">
          <div class="item">1</div>
          <div class="item">2</div>
          <div class="item">3</div>
          <div class="item">4</div>
        </div>
        <div class="box-item">
          <div class="item">1</div>
          <div class="item">2</div>
          <div class="item">3</div>
          <div class="item">4</div>
        </div>
      </div>
    </div>
  </body>
</html>
